package com.learning.rpc.order.service;

import com.learning.rpc.api.order.OrderService;
import com.learning.rpc.api.sms.SmsService;
import com.learning.rpc.config.annocation.RpcReference;
import com.learning.rpc.config.annocation.RpcService;
import org.springframework.stereotype.Service;

import java.util.UUID;

/**
 * ClassName: OrderService
 * Description:
 * Date: 2022/5/10 21:46 【需求编号】
 *
 * @author Sam Sho
 * @version V1.0.0
 */
@Service
public class OrderServiceImpl implements OrderService {

    @RpcReference
    private SmsService smsService;

    @Override
    public void create(String orderContent) {
        System.out.println("订单创建成功，" + orderContent);
        final String result = smsService.send("10086 " + UUID.randomUUID().toString(), "");
        System.out.println("SmsService 服务调用结果： " + result);
    }
}
